<?php

/**
 * 用户数据验证规则
 */

namespace app\validate;

use think\Validate;

class Certificate extends Validate
{
    protected $rule = [
        'id_number' => 'idCard',
        'cert_number' => 'require',
        'institution' => 'require'
    ];
    protected $message = [
        'id_number.idCard' => '身份证格式不正确',
        'cert_number.require' => '证书编号不能为空',
        'institution.require' => '机构名称不能为空',
    ];

    protected $scene = [
        'certificate' => ['id_number', 'cert_number'],
        'institution' => ['cert_number', 'institution'],
    ];
}
